<?php

$parentID = "";

if(@$_GET["parentid"]){
	
	$parentID = $_GET["parentid"];
}

$obTagsSiteChildren = $XML1 -> getSiteChildrenOfTag($parentID);
	
addContent("<table>");

foreach ($obTagsSiteChildren -> getTagIDs() as $obTagsId) {

	$obTag  = $obTagsSiteChildren -> getTag($obTagsId);
	
	//addContent("test:".$obTag -> getData("x_name")."<br/>");
	
	if($obTag -> getData("x_name") != "title"){
	
		if($XML1 -> hasSiteChildren($obTag->getID())){
			
			addContent("<tr><td valign=\"top\"><a href=\"javascript:void(0)\" onclick=\"onlick_openSiteParent(this,'".$obTag->getID()."','".$obTag -> getData("x_section")."')\" style=\"text-decoration:none;\">+</a></td><td><a href=\"javascript:void(0)\" style=\"text-decoration:none;\">".$obTag -> getData("x_name")."</a><div></div></td></tr>");
		}
		else{
			
			if($USER -> IsNameInGroup("Developers") || $USER -> IsNameInGroup("Administrators")){
				
				$currentTagStatus = $XML1 -> getXMLStatus($obTag->getID());
				
				if($currentTagStatus == "1"){
					
					addContent("<tr><td valign=\"top\"></td><td><a href=\"javascript:void(0)\" onclick=\"onclick_getSiteContent(this,'".$obTag->getID()."',false,'".$obTag -> getData("x_section")."')\" style=\"text-decoration:none;\">".$obTag -> getData("x_name")."</a><div></div></td></tr>");
				}
				if($currentTagStatus == "2"){
					
					addContent("<tr><td valign=\"top\"></td><td><a href=\"javascript:void(0)\" onclick=\"onclick_getSiteContent(this,'".$obTag->getID()."',false,'".$obTag -> getData("x_section")."')\" style=\"text-decoration:none;\">".$obTag -> getData("x_name")."</a><div></div></td></tr>");
				}
				if($currentTagStatus == "3"){
					
					addContent("<tr><td valign=\"top\"></td><td><a href=\"javascript:void(0)\" onclick=\"onclick_getSiteContent(this,'".$obTag->getID()."',true,'".$obTag -> getData("x_section")."')\" style=\"text-decoration:none;\">".$obTag -> getData("x_name")."</a><div></div></td></tr>");					
					
				}
				if($currentTagStatus == "4"){
					
					addContent("<tr><td valign=\"top\"></td><td><a href=\"javascript:void(0)\" onclick=\"onclick_getSiteContent(this,'".$obTag->getID()."',false,'".$obTag -> getData("x_section")."')\" style=\"text-decoration:none;\">".$obTag -> getData("x_name")."</a><div></div></td></tr>");
				}
			}
			else{
				
				$currentTagStatus = $XML1 -> getXMLStatus($obTag->getID());
				
				if($currentTagStatus == "1"){
					
					addContent("<tr><td valign=\"top\"></td><td><a href=\"javascript:void(0)\" onclick=\"onclick_getSiteContent(this,'".$obTag->getID()."',false,'".$obTag -> getData("x_section")."')\" style=\"text-decoration:none;\">".$obTag -> getData("x_name")."</a><div></div></td></tr>");
				}
				if($currentTagStatus == "2"){

					if($XML1 -> getPageLocker($obTag->getID()) == $USER -> getID()){
					
						addContent("<tr><td valign=\"top\"></td><td><a href=\"javascript:void(0)\" onclick=\"onclick_getSiteContent(this,'".$obTag->getID()."',true,'".$obTag -> getData("x_section")."')\" style=\"text-decoration:none;\">".$obTag -> getData("x_name")."</a><div></div></td></tr>");
					}
					else{
						
						addContent("<tr><td valign=\"top\"></td><td><a href=\"javascript:void(0)\" onclick=\"onclick_getSiteContent(this,'".$obTag->getID()."',false,'".$obTag -> getData("x_section")."')\" style=\"text-decoration:none;\">".$obTag -> getData("x_name")."</a><div></div></td></tr>");
					}
				}	
			}
			
			//addContent("<tr><td valign=\"top\"></td><td><a href=\"javascript:void(0)\" onclick=\"onclick_getSiteContent(this,'".$obTag->getID()."')\" style=\"text-decoration:none;\">".$obTag -> getData("x_name")."</a><div></div></td></tr>");
		}
	}
}

addContent("</table>");

?>